import 'package:afun_flutter/bindings/home_binding.dart';
import 'package:afun_flutter/utils/Messages.dart';
import 'package:afun_flutter/view/home_page.dart';
import 'package:afun_flutter/view/index_page.dart';
import 'package:afun_flutter/view/order_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

void main(){
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {

    return ScreenUtilInit(
      designSize: const Size(750, 1334), // 设置设计图的尺寸 (宽x高)
      minTextAdapt: true,         // 自动适配文字大小
      splitScreenMode: false,
      builder: (context, child) {
        return GetMaterialApp(
          title: "food",
          translations: Messages(),
          locale: const Locale('zh',"CN"),
          fallbackLocale: const Locale('en','US'),
          theme: ThemeData(
            scaffoldBackgroundColor: const Color.fromRGBO(245, 245, 245,1), //背景色
            textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp),
          ),
          initialRoute: '/',
          getPages: [
            // Home
            GetPage(
                name: '/',
                page: ()=>  HomePage(),
                binding: HomeBinding(),
                children: [
                  GetPage(
                      name: '/index',
                      page: () =>  IndexPage(),
                  ),
                  GetPage(
                      name: '/order',
                      page: () =>  OrderPage(),
                  )
                ]
            ),
          ],
          debugShowCheckedModeBanner: false,
        );
      },
    );
  }
}
